SetKeyboardFocus
NEW WITH THE APPEARANCE MANAGER
Sets the current keyboard focus to a specified control part for a specified window.
pascal OSErr SetKeyboardFocus ( WindowPtr inWindow, ControlHandle inControl, ControlFocusPart inPart);
inWindow
- On input, a pointer to the window containing the control that you wish to receive keyboard focus.
inControl
- On input, a handle to the control that you wish to receive keyboard focus.
inPart
- A part code specifying the part of a control which will receive keyboard focus. To clear a control's keyboard focus, pass
kControlFocusNoPart
. See "Handling Keyboard Focus".- function result
- A result code; see "Result Codes". The result code
errNoRootControl
indicates that keyboard focus is unavailable because the window does not have an embedding hierarchy established. If the specified control doesn't support keyboard focus,errControlDoesntSupportFocus
is returnedDISCUSSION
TheSetKeyboardFocus
function sets the keyboard focus to a specified control part. The control to receive keyboard focus can be deactivated or invisible. This permits you to set the focus for an item in a dialog box before the dialog box is displayed.SEE ALSO
GetKeyboardFocus
."Appearance Manager Gestalt Selector Constants".